<template>
  <div>父组件值：{{ name }}</div>
  <Son :name="name" @getName="getName" />
</template>

<script>
import { ref } from "vue";
import Son from "@/components/08-vue3子组件.vue";
export default {
  components: {
    Son,
  },
  setup() {
    const name = ref("BraveY");
    function getName(newName) {
      console.log(newName);
      name.value = newName;
    }
    return {
      name,
      getName,
    };
  },
};
</script>

<style>
</style>